package ModelRepresentations;

import java.util.ArrayList;
import java.util.HashMap;

public class ModelObject {
	
	/*
	 * Will always have:
	 * Resourceid - as a string or possibly a class....
	 * Properties(i think) - as a dictionary, enclosed within {}
	 * Stencil - as string (remove the "id" from the "id":"value" pair as it always seem to say "id"), enclosed within {}
	 * childshape(usually empty it seems, enclosed inside []) - create a new model and go down one level until end of []
	 * outgoing? - as a list of strings (seem like there is always "resourceid" infront of the pairs, enclosed within [{}]
	 * bounds? - as a dictionary(if it needs to be saved, does not feel very likely)
	 * dockers - list of dictionaries?(enclosed within [{}])
	 * (sometimes) target - store as a string({"resourceid":"..."})
	 * 
	 * stencilset at the end of the file - store in model as a dictionary, enclosed within {}
	 * 
	 */
	
	
	private String resourceID;
	private HashMap<String, String> properties;
	private String stencil;
	private ArrayList<String> outgoing;
	private ArrayList<HashMap<String, String>> dockers;
	private String target;
	private String uniqueID;
	
	/**
	 * gets the ID that is unique for this ModelObject this run
	 * @return the ID as a String
	 */
	public String getUniqueID() {
		return uniqueID;
	}
	
	/**
	 * sets the unique ID
	 * @param uniqueID the id to set
	 */
	public void setUniqueID(String uniqueID) {
		this.uniqueID = uniqueID;
	}
	
	/**
	 * creates an instance of the ModelObject class
	 */
	public ModelObject(){
		properties = new HashMap<String, String>();
		outgoing = new ArrayList<String>();
	}
	
	/**
	 * gets the resourceID for this ModelObject
	 * @return the resourceID as a String
	 */
	public String getResourceID() {
		return resourceID;
	}
	
	/**
	 * gets the resourceID for this ModelObject
	 * @param the resourceID as a String
	 */
	public void setResourceID(String resourceID) {
		this.resourceID = resourceID;
	}
	
	/**
	 * gets the properties for this ModelObject
	 * @return the properties as a HashMap with <theNameOfTheProperty, theValueOfThatProperty>
	 */
	public HashMap<String, String> getProperties() {
		return properties;
	}
	
	/**
	 * sets the properties for this ModelObject
	 * @param the properties as a HashMap with <theNameOfTheProperty, theValueOfThatProperty>
	 */
	public void setProperties(HashMap<String, String> properties) {
		this.properties = properties;
	}
	
	/**
	 * adds a single property with the key "key" and the value "value"
	 * @param key as a String
	 * @param value as a String
	 */
	public void addProperties(String key, String value){
		properties.put(key, value);
	}
	
	/**
	 * gets the type of this ModelObject
	 * @return the type as a String
	 */
	public String getStencil() {
		return stencil;
	}
	
	/**
	 * sets the type of the ModelObject
	 * @param stencil as a String
	 */
	public void setStencil(String stencil) {
		this.stencil = stencil;
	}
	
	/**
	 * gets the outgoing edges of this ModelObject
	 * @return the outgoing as an ArrayList of String, where the Strings hold the ID's of the "target" nodes
	 */
	public ArrayList<String> getOutgoing() {
		return outgoing;
	}
	/**
	 * sets the outgoing edges
	 * @param outgoing an ArrayList of Strings where the Strings is the target nodes ID's(or edges)
	 */
	public void setOutgoing(ArrayList<String> outgoing) {
		this.outgoing = outgoing;
	}
	
	/**
	 * adds a single outgoing edge to the list
	 * @param stringToAdd as a String
	 */
	public void addToOutgoing(String stringToAdd){
		outgoing.add(stringToAdd);
	}
	
	/**
	 * gets the dockers of the ModelObject
	 * @return the dockers as an ArrayList of HashMap's with Strings as keys and values
	 */
	public ArrayList<HashMap<String, String>> getDockers() {
		return dockers;
	}
	
	/**
	 * sets the dockers
	 * @param dockers as ArrayList<HashMap<String, String>>
	 */
	public void setDockers(ArrayList<HashMap<String, String>> dockers) {
		this.dockers = dockers;
	}
	
	/**
	 * gets the target of this ModelObject
	 * @return the target as a String representing an ID
	 */
	public String getTarget() {
		return target;
	}
	
	/**
	 * sets the target if this ModelObject
	 * @param target as a String
	 */
	public void setTarget(String target) {
		this.target = target;
	}
}
